package com.suao.report.service.impl;

import com.suao.report.domain.VGoodsSalesInfo;
import com.suao.report.mapper.VGoodsSalesInfoMapper;
import com.suao.report.service.IVGoodsSalesInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 商品销售统计Service业务层处理
 *
 * @author tyz
 * @date 2023-03-02
 */
@Service
public class VGoodsSalesInfoServiceImpl implements IVGoodsSalesInfoService
{
    @Autowired
    private VGoodsSalesInfoMapper vGoodsSalesInfoMapper;

    /**
     * 查询商品销售统计
     *
     * @param salesTime 商品销售统计主键
     * @return 商品销售统计
     */
    @Override
    public VGoodsSalesInfo selectVGoodsSalesInfoBySalesTime(Date salesTime)
    {
        return vGoodsSalesInfoMapper.selectVGoodsSalesInfoBySalesTime(salesTime);
    }

    /**
     * 查询商品销售统计列表
     *
     * @param vGoodsSalesInfo 商品销售统计
     * @return 商品销售统计
     */
    @Override
    public List<VGoodsSalesInfo> selectVGoodsSalesInfoList(VGoodsSalesInfo vGoodsSalesInfo)
    {
        return vGoodsSalesInfoMapper.selectVGoodsSalesInfoList(vGoodsSalesInfo);
    }

    /**
     * 新增商品销售统计
     *
     * @param vGoodsSalesInfo 商品销售统计
     * @return 结果
     */
    @Override
    public int insertVGoodsSalesInfo(VGoodsSalesInfo vGoodsSalesInfo)
    {
        return vGoodsSalesInfoMapper.insertVGoodsSalesInfo(vGoodsSalesInfo);
    }

    /**
     * 修改商品销售统计
     *
     * @param vGoodsSalesInfo 商品销售统计
     * @return 结果
     */
    @Override
    public int updateVGoodsSalesInfo(VGoodsSalesInfo vGoodsSalesInfo)
    {
        return vGoodsSalesInfoMapper.updateVGoodsSalesInfo(vGoodsSalesInfo);
    }

    /**
     * 批量删除商品销售统计
     *
     * @param salesTimes 需要删除的商品销售统计主键
     * @return 结果
     */
    @Override
    public int deleteVGoodsSalesInfoBySalesTimes(Date[] salesTimes)
    {
        return vGoodsSalesInfoMapper.deleteVGoodsSalesInfoBySalesTimes(salesTimes);
    }

    /**
     * 删除商品销售统计信息
     *
     * @param salesTime 商品销售统计主键
     * @return 结果
     */
    @Override
    public int deleteVGoodsSalesInfoBySalesTime(Date salesTime)
    {
        return vGoodsSalesInfoMapper.deleteVGoodsSalesInfoBySalesTime(salesTime);
    }
}
